The IF keyword that starts an IF...ENDIF block is missing. Also check other control structures within the IF...ENDIF block and verify that they are correctly matched. For example, a nested IF block without a matching ENDIF inside the outer IF...ENDIF block generates this error.